<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>My Engine: Time/TriggeringTimer.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">My Engine
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">Time/TriggeringTimer.h</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef TRIGGERINGTIMER_H_INCLUDED</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define TRIGGERINGTIMER_H_INCLUDED</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &quot;Timer.h&quot;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &quot;../System/EventHandling.h&quot;</span>
<a name="l00006"></a>00006 
<a name="l00007"></a>00007 <span class="keyword">namespace </span>my {
<a name="l00008"></a>00008 
<a name="l00064"></a><a class="code" href="classmy_1_1_triggering_timer.html">00064</a> <span class="keyword">class </span><a class="code" href="classmy_1_1_triggering_timer.html" title="Create a TriggeringTimer. A TriggeringTimer is a Timer that call a binded slot (function or class mem...">TriggeringTimer</a> : <span class="keyword">public</span> my::<a class="code" href="classmy_1_1_timer.html" title="Create a Timer. A Timer is a watch that starts at a given time and that decrease to reach zero...">Timer</a>, <span class="keyword">public</span> my::<a class="code" href="classmy_1_1_event_handling.html" title="Pure Virtual class that provide a simple Signal/Slot system.  A Signal is a string and a Slot is a fu...">EventHandling</a>
<a name="l00065"></a>00065 {
<a name="l00066"></a>00066     <span class="keyword">public</span>:
<a name="l00070"></a>00070         <a class="code" href="classmy_1_1_triggering_timer.html#a7d8c19d87a13a04053443f065a627048" title="Default Constructor. To use the Timer you will need to use reset(float timeLimit, bool continueRunnin...">TriggeringTimer</a>();
<a name="l00071"></a>00071 
<a name="l00078"></a>00078         <a class="code" href="classmy_1_1_triggering_timer.html#a7d8c19d87a13a04053443f065a627048" title="Default Constructor. To use the Timer you will need to use reset(float timeLimit, bool continueRunnin...">TriggeringTimer</a>(<span class="keywordtype">float</span> timeLimit, <span class="keywordtype">bool</span> initRunning = <span class="keyword">false</span>, <span class="keywordtype">bool</span> <a class="code" href="classmy_1_1_triggering_timer.html#a04333fbd92d06473372c965c6868ddeb" title="Is the loop running activated ?">loopRunning</a> = <span class="keyword">false</span>);
<a name="l00079"></a>00079 
<a name="l00083"></a>00083         <span class="keyword">virtual</span> <a class="code" href="classmy_1_1_triggering_timer.html#ab2a1fa34f5de89d458878c1bdf6690be" title="Default destructor.">~TriggeringTimer</a>();
<a name="l00084"></a>00084 
<a name="l00089"></a>00089         <span class="keywordtype">void</span>    <a class="code" href="classmy_1_1_triggering_timer.html#a39a7de0bbdbbbe7c52636133068869fd" title="To set or unset the auto restarting.">setLoopRunning</a>(<span class="keywordtype">bool</span> active = <span class="keyword">true</span>);
<a name="l00090"></a>00090 
<a name="l00095"></a>00095         <span class="keywordtype">bool</span>    <a class="code" href="classmy_1_1_triggering_timer.html#a04333fbd92d06473372c965c6868ddeb" title="Is the loop running activated ?">loopRunning</a>() <span class="keyword">const</span>;
<a name="l00096"></a>00096 
<a name="l00102"></a>00102         <span class="keywordtype">void</span>    <a class="code" href="classmy_1_1_triggering_timer.html#aa3d081edf90ddb62d3af0c41fea39ed1" title="To reset the Timer.">reset</a>(<span class="keywordtype">float</span> timeLimit, <span class="keywordtype">bool</span> keepRunning = <span class="keyword">false</span>);
<a name="l00103"></a>00103 
<a name="l00108"></a>00108         <span class="keywordtype">void</span>    <a class="code" href="classmy_1_1_triggering_timer.html#aa3d081edf90ddb62d3af0c41fea39ed1" title="To reset the Timer.">reset</a>(<span class="keywordtype">bool</span> keepRunning = <span class="keyword">false</span>);
<a name="l00109"></a>00109 
<a name="l00114"></a>00114         <span class="keywordtype">void</span>    <a class="code" href="classmy_1_1_triggering_timer.html#ae340972bdb663d22f2da709a3a692352" title="Bind the expiration of the time with a slot.">bind</a>(my::slot <span class="keyword">function</span>);
<a name="l00115"></a>00115 
<a name="l00119"></a>00119         <span class="keywordtype">void</span>    <a class="code" href="classmy_1_1_triggering_timer.html#a83c5cfadc46da3de5114cc077d468030" title="Update the timer and call the slot binded at expiration. Should be called once a main loop...">update</a>();
<a name="l00120"></a>00120 
<a name="l00121"></a>00121     <span class="keyword">private</span>:
<a name="l00122"></a>00122         <span class="keywordtype">bool</span>    _alreadyExpired;
<a name="l00123"></a>00123         <span class="keywordtype">bool</span>    _loopRunning;
<a name="l00124"></a>00124 };
<a name="l00125"></a>00125 
<a name="l00126"></a>00126 }
<a name="l00127"></a>00127 
<a name="l00128"></a>00128 <span class="preprocessor">#endif // TRIGGERINGTIMER_H_INCLUDED</span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Fri Nov 18 2011 22:34:34 for My Engine by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
